package itsur.arquitecturas.implicitinvocation;

/**************************************************************************************
** Class name: Course
** Author: A.J. Lattanze
** Date: 12/29/99
** Version 1.0
***************************************************************************************
** Purpose: Assignment 2 for SE 17-655, Architectures for Software Systems.  This class
** defines the Course object for the system.
**
** Abstract: 
**
**	boolean RegisterStudent (Student StudentObject) - This method will register a 
**	student for a class.  If the registration is successful, then a true is returned
**	to the caller, if the registrations is unsuccessful, then a false is returned to
**	the caller.
**
**	Registered - This is a StudenList object that maintains a list of	students that
**	have has registered for the course.
**
** There is one method in this class:
**
** 	Register( Student StudentObject ) - This method registers a student for a course 
**	by adding a student for a course.
**
** Modification Log
**************************************************************************************
** M1 - Bug in second constructor
** Author: G.A.Lewis
** Date: 01/25/2001
** Description: Removed null assignment to CourseID after being assigned a value
**************************************************************************************/

class Course
{
	String CourseName;		// Course title
	String CourseID;			// Course number 
	String Section;			// Course section
	String Days;			// Days the course will be held on
	String StartTime;			// Start time of the course
	String StopTime;			// Stop time of the course
	String Instructor;		// Instructor Name
	
	// The following defines a list of students registered for the course

	StudentList Registered = new StudentList();

	Course()
	{
		this.CourseID = null;
		this.CourseName = null;
		this.CourseID = null;
		this.Section = null;
		this.Days = null;
		this.StartTime = null;
		this.StopTime = null;
		this.Instructor = null;

	} // Constructor

	Course( String CourseID )
	{
		this.CourseID = CourseID;
		this.CourseName = null;
		this.Section = null;
		this.Days = null;
		this.StartTime = null;
		this.StopTime = null;
		this.Instructor = null;

	} // Constructor


	public boolean RegisterStudent (Student StudentObject)
	{
		if ( Registered.FindStudent( StudentObject ) )
		{
			return( false );
	
		} else {
					
			Registered.AddStudent( StudentObject );
			return( true );

		} // if 

	} // RegisterStudent


	public void Register( Student StudentObject )
	{
		 Registered.AddStudent( StudentObject );

	} // Register

} // Course class